﻿<phone:PhoneApplicationPage 
    x:Class="MVBuddy.View.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True" DataContext="{Binding Main, Mode=OneWay, Source={StaticResource Locator}}">

	<shell:SystemTray.ProgressIndicator>
		<shell:ProgressIndicator />
	</shell:SystemTray.ProgressIndicator>

	<phone:PhoneApplicationPage.ApplicationBar>
		<shell:ApplicationBar>
			<shell:ApplicationBarIconButton Text="Login" IconUri="/Assets/AppBar/appbar.next.rest.png" Click="Login_Click" />
		</shell:ApplicationBar>
	</phone:PhoneApplicationPage.ApplicationBar>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" DataContext="{Binding Source={StaticResource Locator}}">
    	<Grid.Background>
    		<ImageBrush Stretch="Fill" ImageSource="/MVBuddy;component/Assets/bg.png"/>
    	</Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Background="{StaticResource MVGradient}">
            <TextBlock x:Name="ApplicationTitle" Text="MV BUDDY" Style="{StaticResource PhoneTextNormalStyle}" Margin="12" FontSize="{StaticResource PhoneFontSizeLarge}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        	<StackPanel Margin="0,12,0,0">
        		<TextBlock TextWrapping="Wrap" Text="Usuario" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="Black"/>
        		<TextBox TextWrapping="Wrap" Text="{Binding Main.Username, Mode=TwoWay}" Height="72"/>
        		<TextBlock TextWrapping="Wrap" Text="Contraseña" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="Black"/>
        		<PasswordBox Height="72" Password="{Binding Main.Password, Mode=TwoWay}"/>
        		<CheckBox IsChecked="{Binding Main.SaveLogin, Mode=TwoWay}" Foreground="Black">
        			<CheckBox.Content>
        				<TextBlock TextWrapping="Wrap" Text="Guardar usuario y contraseña. Permite que el tile se actualice automáticamente." FontSize="{StaticResource PhoneFontSizeNormal}" />
					</CheckBox.Content>
        		</CheckBox>
        	</StackPanel></Grid>
    </Grid>
 
</phone:PhoneApplicationPage>